<!DOCTYPE HTML>
<html>
<head>
    <meta charset="utf-8" />
    <title>5-9 PHP中的算术运算符（2）</title>
</head>
<body>
<div align="center">
    <p><a href="index.php"><font size="4">目录</font></a></p>
    <?php
    $maxLine = 4;
    $no = 20;

    $line = ceil($no/$maxLine); //$no 除以 $maxLine 20/4=5
    $row = $no%$maxLine?$no%$maxLine:$maxLine; // $no

    echo "编号<b>".$no."</b>的座位在第<b>".$line."</b>排第<b>".$row."</b>个位置";
    ?>

    <!--总结：

     -->
</div>
</body>
</html>